package com.example.www.Service;

import com.example.www.Entity.User;
import com.example.www.Mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class UserService {

    @Autowired
    private UserMapper userMapper;

    public void addUser(User user){
        userMapper.insert(user);
    }

    public void changeUser(User user){
        userMapper.updateById(user);
    }

    public User getUser(int id){
        return userMapper.selectById(id);
    }
}
